import os

'''
移除图片不存在的标注
删除均压环(jyh issue)所有图片
'''


base_dir = '/home/zlong/bigdata_workspace/bugs_images/'
image_dir = base_dir + 'images/'
annotation_dir = base_dir + 'annotations/'


for p_dir,dirs,files in os.walk(annotation_dir):
    for name in files:
        id = os.path.splitext(name)[0]
        xml_path = annotation_dir + name;
        img_path = image_dir + id + '.jpg'
        if not os.path.exists(img_path) and os.path.exists(xml_path):
            # os.remove(xml_path)
            print("R:"+xml_path)


